package Lesson15;

public class Person 
{
	String name;
	int age;
	long personalNumber;
	boolean isMale;
	double weight;
	double money;
	Car car;
	//int hunger = 50; // from 0 to 100
	//int health = 50; //from 0 to 100
	//int mentalStatus = 50; // from 0 to 100
	Person[] friends;
	
	Person()
	{
		this.age = 0;
		this.weight = 4.0;
	}
	
	Person(String name, long personalNumber, boolean isMale, double money)
	{
		this();
		this.money=money;
		this.name = name;
		this.personalNumber = personalNumber;
		this.isMale = isMale;
		this.friends = new Person[3];
		for (int i=0; i<this.friends.length; i++)
		{
			this.friends[i] = new Person();
		}
	}
	
	Person(Person person)
	{
		
	}
	/*
	void eat(int foodVolume)
	{
		if (hunger+foodVolume>=100)
			hunger=100;
		else
			hunger+=foodVolume;
	}
	
	void walk()
	{
		System.out.println(name + "is walking");
		hunger-=5;
	}
	void grow()
	{
		age++;
	}
	void drinkWater(double litres)
	{
		System.out.println(name + " is drinking " + litres + " litres of water");
		hunger--;
	}
	*/
	void buyCar (Car car)
	{
		if (this.money >= car.price)
		{
			this.car = car;
			car.changeOwner(this);
		}
		
	}
	
}
